package com.wanxi.student;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        Map<Student, String> map = new HashMap<>();
        map.put(new Student("张三1", 22), "成都1");
        map.put(new Student("张三2", 22), "成都2");
        map.put(new Student("张三3", 22), "成都3");
        map.put(new Student("张三4", 22), "成都4");
        Set<Student> students = map.keySet();
        Iterator<Student> iterator = students.iterator();
        while (iterator.hasNext()) {
            Student next = iterator.next();
            System.out.println(next.getName() + "---" + map.get(next));
        }
    }
}
